# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=dav1d
pkgver=1.5.0
pkgrel=0
pkgdesc="small and fast AV1 Decoder"
url="https://code.videolan.org/videolan/dav1d"
arch="all"
license="BSD-2-Clause"
makedepends="
	meson
	nasm
	"
subpackages="$pkgname-dev lib$pkgname:libs"
source="https://code.videolan.org/videolan/dav1d/-/archive/$pkgver/dav1d-$pkgver.tar.bz2"

build() {
	CFLAGS="$CFLAGS -O2" \
	CXXFLAGS="$CXXFLAGS -O2" \
	abuild-meson \
		-Db_lto=true \
		-Denable_tests=true \
		-Denable_tools=true \
		-Dfuzzing_engine=none \
		-Dtestdata_tests=false \
		-Denable_asm=true \
		build
	meson compile -C build
}

check() {
	meson test --no-rebuild --print-errorlogs -C build
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C build
}

sha512sums="
cb6ab1c66acc9f7c792980cbc270e7f3000ecbd4a238b9cf41cc9f557691731f0146bea2483c14a9f70e72611fd1f8c2946faab792c60608ceaf7c0cbfe70b26  dav1d-1.5.0.tar.bz2
"
